function updateProfile(event) {
    switch (event["type"]) {
        case "head-image":
            $("#profile-photo").attr("src", "/chat/static/images/head/" + event["userID"] + ".ico?" + String(Math.random()));
            break;
        case "user-status":
            let user_status_color_choose = document.getElementById("user-status-color"),
                user_status_text = document.getElementById("user-status-text");
            switch (event["user-status"]) {
                case 120:
                    user_status_color_choose.style = "background-color:green;width:16px;height:16px;border-radius:50%;";
                    user_status_text.innerHTML = "在线";
                    user_status = "online";
                    user_status_color = "rgb(0,255,0)";
                    break;
                case 121:
                    user_status_color_choose.style = "background-color:yellow;width:16px;height:16px;border-radius:50%;";
                    user_status_text.innerHTML = "忙碌";
                    user_status = "busy";
                    user_status_color = "rgb(255,255,0)";
                    break;
                case 122:
                    user_status_color_choose.style = "background-color:red;width:16px;height:16px;border-radius:50%;";
                    user_status_text.innerHTML = "离开";
                    user_status = "leave";
                    user_status_color = "rgb(255,0,0)";
                    break;
                case 123:
                    user_status_color_choose.style = "background-color:white;width:16px;height:16px;border-radius:50%;";
                    user_status_text.innerHTML = "隐身";
                    user_status = "hidden";
                    user_status_color = "rgb(100,100,100)";
                    break;
            }
            break;
        case "user-friends":
            var friends = event["friends"];
            for (let friend in friends) {
                var friend_status = document.createElement('div'),
                    friend_head_img = document.createElement('div'),//TODO
                    friend_name = document.createElement("p");
                switch (friend[2]) {
                    case 120:
                        user_status_color.style = "background-color:green;width:16px;height:16px;border-radius:50%;";
                        user_status_text.innerHTML = "在线";
                        break;
                    case 121:
                        user_status_color.style = "background-color:yellow;width:16px;height:16px;border-radius:50%;";
                        user_status_text.innerHTML = "忙碌";
                        break;
                    case 122:
                        user_status_color.style = "background-color:red;width:16px;height:16px;border-radius:50%;";
                        user_status_text.innerHTML = "离开";
                        break;
                    case 123:
                        user_status_color.style = "background-color:white;width:16px;height:16px;border-radius:50%;";
                        user_status_text.innerHTML = "隐身";
                }
            }
            break;
        case "msg-user-status":
            switch (event["status"]) {
                case 120:
                    var msg_user_status = "2px solid rgb(0,255,0)";
                    break;
                case 121:
                    var msg_user_status = "2px solid rgb(255,255,0)";
                    break;
                case 122:
                    var msg_user_status = "2px solid rgb(255,0,0)";
                    break;
                case 123:
                    var msg_user_status = "2px solid rgb(100,100,100)";
                    break;
            }
            var msg_user_status_len = $(".msg-user-name").length;
            for (let i = 0; i < msg_user_status_len; i++) {
                if ($($(".msg-user-name")[i]).text() === event["username"]) {
                    $($($(".msg-user-name")[i]).prev()).css("border", msg_user_status);
                }
            }
            delete msg_user_status_len, msg_user_status;
            break;
        case "msg-user-profile-photo":
            var user_pfph_len = $(".msg-user-profile-photo").length;
            var user_pfph_timestamp = new Date().getTime();
            for (let i = 0; i < user_pfph_len; i++) {
                var user_pfph_src = $($(".msg-user-profile-photo")[i]).attr("src") + "?saved-timestamp=" + user_pfph_timestamp;
                $($(".msg-user-profile-photo")[i]).attr("src", user_pfph_src);
                image_plus_fixer = "?saved-timestamp=" + user_pfph_timestamp;
            }
            delete user_pfph_timestamp, user_pfph_len, user_pfph_src;
            break;
    }
}